package com.douqu.game.core.database.model;

import com.douqu.game.core.e.E_RechargeStatus;

import java.util.Date;

/**
 * @Author: Bean
 * @Description:
 * @Date: 2017-12-29 15:28
 */
public class OrderRecordModel {

    private int id;
    private String objectIndex;
    private String uid;
    /** 目前只有易接有值 */
    private String ssid;
    /** 平台订单号 */
    private String tcd;
    private String channel;
    private int money;
    private int rechargeId;
    private int serverId;
    private Date createTime;
    private Date completeTime;
    private int status;
    private String outTradeNo;
    //以下字段在数据库是没有的,不需要存储的
    /**支付类型*/
    private String paymentType;
    /** talkingData 新增*/
    private int virtualCurrencyAmount;
    private String iapID;
    private String gameVersion;
    private int level;
    private String mission;
    private int partner;

    public OrderRecordModel() {
    }

    public OrderRecordModel(String objectIndex, String uid, String ssid, String tcd, String channel, int money, int rechargeId, int serverId,String outTradeNo,
                            int level,int virtualCurrencyAmount,int partner,String paymentType, E_RechargeStatus status)
    {
        this.objectIndex = objectIndex;
        this.uid = uid;
        this.ssid = ssid;
        this.tcd = tcd;
        this.channel = channel;
        this.money = money;
        this.rechargeId = rechargeId;
        this.serverId = serverId;
        this.outTradeNo = outTradeNo;
        this.status = status.getCode();//已完成
        this.level = level;
        this.virtualCurrencyAmount = virtualCurrencyAmount;
        this.partner = partner;
        this.paymentType = paymentType;
        //渠道 钻石
    }

    public void paySuccess(String gameVersion, int virtualCurrencyAmount, int level, String channel, String payType, int partner, String platformTradeNo)
    {
        this.gameVersion = gameVersion;
        this.virtualCurrencyAmount = virtualCurrencyAmount;
        this.level = level;
        this.channel = channel;
        this.paymentType = payType;
        this.partner = partner;
        this.tcd = platformTradeNo;
        this.status = E_RechargeStatus.PAY_SUCCESS.getCode();
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getObjectIndex() {
        return objectIndex;
    }

    public void setObjectIndex(String objectIndex) {
        this.objectIndex = objectIndex;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getSsid() {
        return ssid;
    }

    public void setSsid(String ssid) {
        this.ssid = ssid;
    }

    public String getTcd() {
        return tcd;
    }

    public void setTcd(String tcd) {
        this.tcd = tcd;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public int getRechargeId() {
        return rechargeId;
    }

    public void setRechargeId(int rechargeId) {
        this.rechargeId = rechargeId;
    }

    public int getServerId() {
        return serverId;
    }

    public void setServerId(int serverId) {
        this.serverId = serverId;
    }

    public Date getCompleteTime() {
        return completeTime;
    }

    public void setCompleteTime(Date completeTime) {
        this.completeTime = completeTime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }


    public int getVirtualCurrencyAmount() {
        return virtualCurrencyAmount;
    }

    public void setVirtualCurrencyAmount(int virtualCurrencyAmount) {
        this.virtualCurrencyAmount = virtualCurrencyAmount;
    }

    public String getIapID() {
        return iapID;
    }

    public void setIapID(String iapID) {
        this.iapID = iapID;
    }

    public String getPaymentType() {
        return paymentType;
    }

    public void setPaymentType(String paymentType) {
        this.paymentType = paymentType;
    }

    public String getGameVersion() {
        return gameVersion;
    }

    public void setGameVersion(String gameVersion) {
        this.gameVersion = gameVersion;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getMission() {
        return mission;
    }

    public void setMission(String mission) {
        this.mission = mission;
    }

    public int getPartner() {
        return partner;
    }

    public void setPartner(int partner) {
        this.partner = partner;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    @Override
    public String toString() {
        return "{" +
                "id=" + id +
                ", objectIndex='" + objectIndex + '\'' +
                ", uid='" + uid + '\'' +
                ", ssid='" + ssid + '\'' +
                ", tcd='" + tcd + '\'' +
                ", channel='" + channel + '\'' +
                ", money=" + money +
                ", rechargeId=" + rechargeId +
                ", serverId=" + serverId +
                ", createTime=" + createTime +
                ", completeTime=" + completeTime +
                ", status=" + status +
                ", outTradeNo='" + outTradeNo + '\'' +
                ", virtualCurrencyAmount=" + virtualCurrencyAmount +
                ", iapID='" + iapID + '\'' +
                ", paymentType='" + paymentType + '\'' +
                ", gameVersion='" + gameVersion + '\'' +
                ", level=" + level +
                ", mission='" + mission + '\'' +
                ", partner=" + partner +
                '}';
    }
}
